﻿using AutoMapper;
using BW.MesProject.Public.ErrorCode;
using BW.MesProject.Public.Infrastructure;
using BW.MesProject.WareHouse.Domain;
using BW.MesProject.WareHouse.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BW.MesProject.WareHouse.Application
{
    /// <summary>
    /// 标签解析规则
    /// </summary>
   
    public class TagParseRulesServices : ITagParseRulesServices
    {
        private readonly IBaseRepository<TagParseRulesModel> _TagParseRules;
        private readonly IMapper _mapper;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="Emp"></param>
        /// <param name="mapper"></param>
        public TagParseRulesServices(IBaseRepository<TagParseRulesModel> TagParseRules, IMapper mapper)
        {
            _TagParseRules = TagParseRules;
            this._mapper = mapper;
        }


        /// <summary>
        /// 标签解析规则
        /// </summary>
        /// <param name="TagParseRulesName"></param>
        /// <returns></returns>
        public ApiResult<List<TagParseRulesModel>> GetTagParseRules(string? TagParseRulesName)
        {
            int totalCount = 0;
            //查询名称来显示数据
            var list = _TagParseRules.GetAll();
            List<TagParseRulesModel> TagParseRuleslist = new List<TagParseRulesModel>();
            TagParseRuleslist = list.OrderBy(u => u.TagParseRulesId).ToList();
            return new ApiResult<List<TagParseRulesModel>>()
            {
                Code = ApiEnums.Success,
                Message = "查询成功",
                Data = TagParseRuleslist.ToList(),
                TotalCount = 0,
            };
        }

    }
}
